package com.vipkid.archdemos;

import ch.qos.logback.classic.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GreetingController {
    Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger("mylog");

    @RequestMapping("/")
    public String greeting(@RequestParam(value = "name", defaultValue = "World") String name) {
        String str = String.format("hi %s", name);
        logger.info(str);
        return str;
    }
}